﻿namespace NTLib.Core.Component
{
    using System;

    /// <summary>
    /// Interface used define the behavior of loadinf and unloading item
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IComponentLoader<T>
        where T : IComponent
    {
        #region Methods

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        /// <param name="item">The item.</param>
        Guid Register(T item);

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        Guid Register<U>() where U : T;

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        Guid Register(Type type);

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        void UnRegister<U>() where U : T;

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        /// <param name="item">The item.</param>
        void UnRegister(T item);

        /// <summary>
        /// Register the specific component type and return the type GUID.
        /// </summary>
        /// <param name="type">The type.</param>
        void UnRegister(Type type);

        /// <summary>
        /// Unload the specific component.
        /// </summary>
        /// <param name="id">Component unique id</param>
        void UnRegister(Guid id);

        #endregion
    }
}
